﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Exchange.WebServices.Data;
using MsExchangeBcsConnector.ExchangeBdcModel.Helpers;

namespace MsExchangeBcsConnector.ExchangeBdcModel

{
    /// <summary>
    /// This class contains the properties for Entity1. The properties keep the data for Entity1.
    /// If you want to rename the class, don't forget to rename the entity in the model xml as well.
    /// </summary>
    public partial class Message : SecureEntity
    {
        
        public string MessageID { get; set; }        
        public string Body { get; set; }
        public string Subject { get; set; }
        public string From { get; set; }
        public string To { get; set; }
        public System.DateTime Date { get; set; }
        public string Url{ get; set; }
      //  public Attachment[] Attachments { get; set; }
        

        
        #region Constructors

        // Empty constructors to support serialization
        public Message() {
            Date = DateTime.Now;
        }

        public Message(string EMail, string MessageID) : this()
        {
            this.EMail = EMail;
            this.MessageID = MessageID;
        }

        internal static string FormatDisplayUrl(string BcsProfile_HostURL, string LobSystemInstanceName, string MessageId)
        {
            return String.Format("{0}/{1}.eml", BcsProfile_HostURL, Base32Url.ToBase32String(MessageId));
        }


 

        #endregion
    }
}

